package com.biz.primus.management.commodity.feign;

import com.biz.primus.commodity.vo.CategoryQueryVo;
import com.biz.primus.commodity.vo.backend.CategoryListItemVo;
import com.biz.primus.commodity.vo.backend.UpdateCategoryVo;
import com.biz.primus.common.vo.SpringPageVO;
import com.biz.primus.management.commodity.degraded.DegradedCategoryFeignClient;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 分类Feign Client
 *
 * @author david-liu
 */
@FeignClient(name = "service-commodity", fallback = DegradedCategoryFeignClient.class)
public interface CategoryFeignClient {

    @PostMapping("soa/categoryService/findAll")
     SpringPageVO<CategoryListItemVo> findAll(@RequestBody CategoryQueryVo reqVo);

    @GetMapping("soa/categoryService/getCategoryById")
    UpdateCategoryVo getCategoryById(@RequestParam("id") Long categoryId);

    @PostMapping("soa/categoryService/updateCategory")
    void update(UpdateCategoryVo categoryVo);
}
